<template>
  <div class="agree-container">
    <div class="list">
      <AgreeBar 
        v-for="(item, index) of listData" 
        :key="index"
        :index="index" 
        :itemData="item"
      />
    </div>
    <van-button type="primary" block class="btn-ok">确认</van-button>
  </div>
</template>

<script>
import AgreeBar from '@/components/AgreeBar/index.vue';

export default {
  name: 'Agree',
  components: {
    AgreeBar
  },
  data() {
    return {
      listData: [{
        name: '小明',
        grade: 3,
        isAgree: false,
        cause: ''
      }, {
        name: '张三',
        grade: 9,
        isAgree: false,
        cause: ''
      }, {
        name: '李四',
        grade: 1,
        isAgree: false,
        cause: ''
      }, {
        name: '小明',
        grade: 6,
        isAgree: false,
        cause: ''
      }, {
        name: '李四',
        grade: 1,
        isAgree: false,
        cause: ''
      }, {
        name: '小明',
        grade: 6,
        isAgree: false,
        cause: ''
      }, {
        name: '李四',
        grade: 1,
        isAgree: false,
        cause: ''
      }, {
        name: '小明',
        grade: 6,
        isAgree: false,
        cause: ''
      }]
    }
  }
}
</script>

<style scoped lang="scss">
  .agree-container {
    position: relative;
    height: 100%;

    .list {
      height: 100%;
      padding: .2rem .2rem 0;
      overflow: auto;
    }

    .btn-ok {
      position: absolute;
      bottom: 0;
      left: 0;
    }
  }
</style>